﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLBH.CongNo
{
    public partial class frmFindDlg : Form
    {
        private String searchInput;

        public String SearchInput
        {
            get { return searchInput; }            
        }
        public frmFindDlg()
        {
            InitializeComponent();
        }

        private void frmFindDlg_Load(object sender, EventArgs e)
        {
            tbxHoTen.SelectAll();
            tbxHoTen.Focus();
        }

        private void frmFindDlg_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode==Keys.Enter)
            {
                btnFind_Click(btnFind, null);
            }
            else if (e.KeyCode==Keys.Escape)
            {
                this.DialogResult = DialogResult.Cancel;
                this.Close();
            }
        }

        private void btnFind_Click(object sender, EventArgs e)
        {
            searchInput = tbxHoTen.Text;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
